package enterprise.manage.web.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import enterprise.manage.entity.Partner;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Created by IntelliJ IDEA.
 * User: liyong
 * Date: 2010-12-7
 * Time: 14:52:22
 * desc:
 */
public class LogoutController extends AbstractController {

    private static final String indexView = "redirect: /index.aspx";

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {

        HttpSession session = request.getSession();

        Partner partner = (Partner) session.getAttribute("partner");
        String username = (String) session.getAttribute("username");
        session.removeAttribute("partner");
        session.removeAttribute("username");
        return new ModelAndView("index");
    }
}
